package com.ruoyi.common.exception;

import com.ruoyi.common.base.Result;

public class CustomException extends Exception {
    private Result result;

    public CustomException() {
        super();
    }

    public static CustomException instance(Integer code, String msg) {
        CustomException exception = new CustomException();
        Result result = Result.failed(code, msg);
        exception.setResult(result);
        return exception;
    }

    public Result getResult() {
        return result;
    }

    public void setResult(Result result) {
        this.result = result;
    }
}
